package main

import "fmt"

type Person interface {
	eat()
}
type Dancer interface {
	Person // 通过匿名字段实现
	dance()
}

type Rapper struct {
	name string
	age  int
}

func (receiver *Rapper) eat() {
	fmt.Println(receiver.name, "-", "eating")
}
func (receiver Rapper) dance() {
	fmt.Println(receiver.name, "-", "dancing")
}

func main() {
	var d Dancer
	// 如果有指针，还有普通方法 --> 用指针
	d = &Rapper{"mike", 18}
	d.eat()
	d.dance()
}
